package com.damuzee.system.admin.action;

import javax.annotation.Resource;

import org.mybatis.sql.page.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.damuzee.system.admin.domain.EmpUser;
import com.damuzee.system.admin.service.EmpUserService;

@Controller
public class EmpUserAction {

	@RequestMapping(value="/employee/v_list.do")
	public String list(Integer pageNo ,ModelMap map){
		Page<EmpUser> page = new Page<EmpUser>();
		page.setCurrentPage(pageNo);
		EmpUser  user  = new EmpUser();
		//user.setUserName("admin");
		page = userSerivce.getEmpUserList(page,user);
		
		map.addAttribute("page", page.getPage());
		return "/employee/list" ;
	}
	
	@RequestMapping(value="/employee/v_add.do")
	public String add(){
		return  "/employee/add" ;
	}
	
	@RequestMapping(value="/employee/o_save.do")
	public String save(EmpUser empUser,String reUserPwd){
		userSerivce.saveUser(empUser);
		return "redirect:v_list.do" ;
	}
	@Resource
	private EmpUserService userSerivce ;
	
	
}
